//引入vue
import Vue from "vue"
//引入VueRouter
import  VueRouter  from "vue-router"

//引入路由组件
import Home from "../pages/Home"
import Login from "../pages/Login"
import Music from "../pages/Home/Music"
import News from "../pages/Home/News"

//让vue使用VueRouter这个插件
Vue.use(VueRouter)

//创建路由器对象并暴露
export default new VueRouter({
//在实例化路由器对象中书写路由配置
routes:[
    {path:"/login",component:Login,name:'login'},
    {
        path:"/Home",
        component:Home,
        name:"home",
        children:[
            {path:"/home/music",component:Music,name:"music"},
            {path:"/home/news",component:News,name:"news"}
        ]
    },

]

})